<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="root">
        <!-- 字符串    -->
        <p style="background:yellow;color:red;">1</p>
        <p :style="'background:yellow;color:red;'">2</p>
        <p :style='"background:yellow;color:red;"'>3</p>
        <p :style ="one">4</p>
        <!-- 对象    -->
        <p :style="{background:'green',color:'pink'}">5</p>
        <p :style="two">6</p>
        <!-- 数组    -->
        <p :style="[{background:'yellow'},{color:'red'}]">7</p>
        <p :style="[bg,cl]">8</p>
    </div>
</body>
<script>
    new Vue({
        el:"#root",
        data:{
            one:"background:yellow;color:red;",
            two:{background:'green',color:'pink'},
            bg:{
                background:"yellow"
            },
            cl:{
                color:"red"
            }
        }
    })
</script>
</html>